package top.codedance.iotp.client.net.configuration;

import top.codedance.iotp.common.constent.Command;
import top.codedance.iotp.common.entity.CommandTeam;
import top.codedance.iotp.common.entity.ExecuterRegistEntity;

import java.util.ArrayList;
import java.util.List;

public class ExecuterRegistConfig {
    /**
     * 同步执行器配置
     * @return
     */
    public static List<ExecuterRegistEntity> getSyscExecuters(){
        List<ExecuterRegistEntity> executers = new ArrayList<>();
        executers.add(new ExecuterRegistEntity("viewVersion", new CommandTeam(Command.VIEW_CLIENT_VERSION, Command.VIEW_CLIENT_VERSION_RECEIVE), new top.codedance.iotp.client.plugins.sync.client.ViewVersionExecuterImpl()));
        executers.add(new ExecuterRegistEntity("shutdown", new CommandTeam(Command.SHUTDOWN, Command.SHUTDOWN_RECEIVE), new top.codedance.iotp.client.plugins.sync.client.ShutdownExecuterImpl()));
        executers.add(new ExecuterRegistEntity("system", new CommandTeam(Command.SYSTEM_COMMAND, Command.SYSTEM_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.system.SystemExecuterImpl()));
        executers.add(new ExecuterRegistEntity("com", new CommandTeam(Command.COM_COMMAND, Command.COM_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.com.ComExecuterImpl()));
        executers.add(new ExecuterRegistEntity("udp", new CommandTeam(Command.UDP_COMMAND, Command.UDP_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.udp.UdpExecuterImpl()));
        executers.add(new ExecuterRegistEntity("opc", new CommandTeam(Command.OPC_COMMAND, Command.OPC_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.opc.OpcExecuterImpl()));
        executers.add(new ExecuterRegistEntity("can", new CommandTeam(Command.CAN_COMMAND, Command.CAN_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.can.CanExecuterImpl()));
        executers.add(new ExecuterRegistEntity("dnp", new CommandTeam(Command.DNP_COMMAND, Command.DNP_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.dnp.DnpExecuterImpl()));
        executers.add(new ExecuterRegistEntity("bacnet", new CommandTeam(Command.BACNET_COMMAND, Command.BACNET_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.bacnet.BacNetExecuterImpl()));
        executers.add(new ExecuterRegistEntity("iec", new CommandTeam(Command.IEC_COMMAND, Command.IEC_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.iec.IECExecuterImpl()));
        executers.add(new ExecuterRegistEntity("mtconnect", new CommandTeam(Command.MTCONNECT_COMMAND, Command.MTCONNECT_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.mtconnect.MtConnectExecuterImpl()));
        executers.add(new ExecuterRegistEntity("profibus", new CommandTeam(Command.PROFIBUS_COMMAND, Command.PROFIBUS_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.profibus.ProfibusExecuterImpl()));
        executers.add(new ExecuterRegistEntity("profinet", new CommandTeam(Command.PROFINET_COMMAND, Command.PROFINET_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.profinet.ProfinetExecuterImpl()));
        executers.add(new ExecuterRegistEntity("modbus", new CommandTeam(Command.MODBUS_COMMAND, Command.MODBUS_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.modbus.ModbusExecuterImpl()));
        executers.add(new ExecuterRegistEntity("http", new CommandTeam(Command.HTTP_COMMAND, Command.HTTP_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.http.HttpExcuterImpl()));
        executers.add(new ExecuterRegistEntity("pushData", new CommandTeam(Command.PUSH_DATA_COMMAND, Command.PUSH_DATA_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.http.PushDataExecuterImpl()));
        executers.add(new ExecuterRegistEntity("genericdb", new CommandTeam(Command.GENERICDB_COMMAND, Command.GENERICDB_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.db.generic.GenericExecuterImpl()));
        executers.add(new ExecuterRegistEntity("mysql", new CommandTeam(Command.MYSQL_COMMAND, Command.MYSQL_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.db.mysql.MysqlExecuterImpl()));
        executers.add(new ExecuterRegistEntity("mssql", new CommandTeam(Command.MSSQL_COMMAND, Command.MSSQL_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.db.mssql.MssqlExecuterImpl()));
        executers.add(new ExecuterRegistEntity("oracle", new CommandTeam(Command.ORACLE_COMMAND, Command.ORACLE_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.sync.db.oracle.OracleExecuterImpl()));
        executers.add(new ExecuterRegistEntity("setClientPluginsParams", new CommandTeam(Command.CLIENT_PLUGINS_PARAMS_SET, Command.CLIENT_PLUGINS_PARAMS_SET_RECEIVE), new top.codedance.iotp.client.plugins.sync.client.ClientPluginsParamsSetExecuterImpl()));
        executers.add(new ExecuterRegistEntity("getClientPluginsParams", new CommandTeam(Command.CLIENT_PLUGINS_PARAMS_GET, Command.CLIENT_PLUGINS_PARAMS_GET_RECEIVE), new top.codedance.iotp.client.plugins.sync.client.ClientPluginsParamsGetExecuterImpl()));
        executers.add(new ExecuterRegistEntity("setClientBootParams", new CommandTeam(Command.CLIENT_BOOT_PARAMS_SET, Command.CLIENT_BOOT_PARAMS_SET_RECEIVE), new top.codedance.iotp.client.plugins.sync.client.ClientBootParamsSetExecuterImpl()));
        executers.add(new ExecuterRegistEntity("getClientBootParams", new CommandTeam(Command.CLIENT_BOOT_PARAMS_GET, Command.CLIENT_BOOT_PARAMS_GET_RECEIVE), new top.codedance.iotp.client.plugins.sync.client.ClientBootParamsGetExecuterImpl()));

        return executers;
    }

    /**
     * 异步执行器配置
     * @return
     */
    public static List<ExecuterRegistEntity> getExecuters(){
        List<ExecuterRegistEntity> executers = new ArrayList<>();
        executers.add(new ExecuterRegistEntity("com", new CommandTeam(Command.ASYNC_COM_COMMAND, Command.ASYNC_COM_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.async.com.ComExecuterImpl()));
        executers.add(new ExecuterRegistEntity("udp", new CommandTeam(Command.ASYNC_UDP_COMMAND, Command.ASYNC_UDP_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.async.udp.UdpExecuterImpl()));
        executers.add(new ExecuterRegistEntity("opc", new CommandTeam(Command.ASYNC_OPC_COMMAND, Command.ASYNC_OPC_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.async.opc.OpcExecuterImpl()));
        executers.add(new ExecuterRegistEntity("system", new CommandTeam(Command.ASYNC_SYSTEM_COMMAND, Command.ASYNC_SYSTEM_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.async.system.SystemExecuterImpl()));
        executers.add(new ExecuterRegistEntity("mqtt", new CommandTeam(Command.ASYNC_MQTT_COMMAND, Command.ASYNC_MQTT_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.async.mqtt.MqttExecuterImpl()));
        executers.add(new ExecuterRegistEntity("push", new CommandTeam(Command.ASYNC_PUSH_DATA_COMMAND, Command.ASYNC_PUSH_DATA_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.async.push.PushExecuterImpl()));
        executers.add(new ExecuterRegistEntity("bacnet", new CommandTeam(Command.ASYNC_BACNET_COMMAND, Command.ASYNC_BACNET_COMMAND_RECEIVE), new top.codedance.iotp.client.plugins.async.bacnet.BacnetExecuterImpl()));

        return executers;
    }
}
